package com.glsc.ngateway.common.base.domain.mysql.opmanage.report.regulatory;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
 * @author: qiyr
 * @date: 2022/6/23 15:27
 * @description: 监管报送数据主实体类
 */
@Data
@Entity
@Table(name = "t_reg_rpt_main")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class RegRptMain {

    @Id
    @Column(name = "id" , columnDefinition = "bigint")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private BigInteger id;

    @Column(name = "rpt_define_id" , columnDefinition = "bigint")
    private BigInteger reportDefineId;

    @Column(name = "bizdate")
    private String bizdate;

    @Column(name = "dimension1")
    private String dimension1;

    @Column(name = "ref_ids")
    private String refIds;

    @Column(name = "file_id")
    private String fileId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @Column(name = "create_time", insertable = false, updatable = false)
    private LocalDateTime createTime;

    @Column(name = "operator")
    private String operator;

    @Column(name = "status")
    private Integer status;

    public RegRptMain() {
    }

    public RegRptMain(BigInteger reportDefineId, String bizdate, String dimension1, String refIds, String fileId,
                      LocalDateTime createTime, String operator, Integer status) {
        this.reportDefineId = reportDefineId;
        this.bizdate = bizdate;
        this.dimension1 = dimension1;
        this.refIds = refIds;
        this.fileId = fileId;
        this.createTime = createTime;
        this.operator = operator;
        this.status = status;
    }

    public BigInteger getId() {
        return id;
    }

    public void setId(BigInteger id) {
        this.id = id;
    }

    public BigInteger getReportDefineId() {
        return reportDefineId;
    }

    public void setReportDefineId(BigInteger reportDefineId) {
        this.reportDefineId = reportDefineId;
    }

    public String getBizdate() {
        return bizdate;
    }

    public void setBizdate(String bizdate) {
        this.bizdate = bizdate;
    }

    public String getDimension1() {
        return dimension1;
    }

    public void setDimension1(String dimension1) {
        this.dimension1 = dimension1;
    }

    public String getRefIds() {
        return refIds;
    }

    public void setRefIds(String refIds) {
        this.refIds = refIds;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
